<?php
/**
 * @Name: StaffRelationNewUser.php
 * @Author: yashuai
 * @Desc 员工关联新用户
 */

namespace App\Http\Requests\Org;

use App\Http\Requests\PackingRequest;

class StaffRelationNewUserRequest extends PackingRequest
{

    public function rules()
    {
        return [
            'StaffID'      => 'required|integer',
            'UserName'     => 'required|max:50',
            'NickName'     => 'required|max:20',
            'UserPassword' => 'required|between:6,32|alpha_dash',
            'RoleID'       => 'array',
            'RoleID.*'     => 'integer',
        ];
    }

    public function messages()
    {
        return [
            'StaffID.required'        => '缺少员工ID参数',
            'StaffID.integer'         => '员工ID参数类型异常',
            'UserName.required'       => '请输入账号',
            'UserName.max'            => '账号长度过长',
            'UserPassword.required'   => '请输入用户密码',
            'UserPassword.between'    => '密码长度为6-30位',
            'UserPassword.alpha_dash' => '密码只能包含字母、数字，以及破折号和下划线',
            'NickName.required'       => '请输入昵称',
            'NickName.max'            => '昵称长度过长',
            'RoleID.array'            => '角色ID参数格式异常',
        ];
    }

}
